package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.SetmealDTO;
import com.sky.entity.Dish;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {
    @Select("select * from setmeal where category_id = #{id}")
    List<Setmeal> getByCateId(Integer id);

    @AutoFill(OperationType.INSERT)
    void insert(Setmeal setmeal);

    Page<SetmealVO> selectByQuery(String name, Integer categoryId, Integer status);

    @Select("select * from setmeal where id = #{id}")
    SetmealDTO getById(Integer id);

    @AutoFill(OperationType.UPDATE)
    void update(Setmeal setmeal);

    List<Setmeal> getByIds(Integer[] ids);

    void deleteByIds(Integer[] ids);

    void setStatusByIds(Integer[] integers);

    List<Setmeal> getByCategroyId(Integer categoryId);

    List<Dish> getDishBySetmealId(Integer id);

    @Select("select * from setmeal where id = #{id}")
    Setmeal getByLongId(Long setmealId);
}
